<template>
  <div class="flex v h">
    子组件：<input type="color" name="" v-model="data">
  </div>
</template>

<script setup>
import { useVModel } from '@/assets/js/hooks/useVModel';

// codeFragment-split
// 子组件
const props = defineProps([ 'modelValue' ]);
// 可不定义 emit
// const emit = defineEmits([ 'update:modelValue' ]);

// 修改data 会触发 emit
const data = useVModel(props, 'modelValue');
</script>
